package org.nf.ssm.service.impl;

import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import org.nf.ssm.dao.UserDao;
import org.nf.ssm.domain.User;
import org.nf.ssm.service.UserService;
import org.springframework.stereotype.Service;

/**
 * @author zhu
 * @date 2024-10-17
 */
@Service("userService")
@RequiredArgsConstructor
public class UserServiceImpl implements UserService {

    private final UserDao userDao;

    @Override
    public void deleteUser(Integer userId) {
        userDao.deleteUser(userId);
    }

    @Override
    public void addUser(User user) {
        userDao.addUser(user);
    }

    @Override
    public PageInfo<User> getAllUser(Integer pageNum, Integer pageSize) {
        return new PageInfo<>(userDao.getAllUser(pageNum, pageSize));
    }

    @Override
    public void updateUser(User user) {
        userDao.updateUser(user);
    }
}
